/*
 * Copyright (C) 2011 Project R'yleh Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.Arkham;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.TextView;

public class Introductions extends Activity  implements OnClickListener{
	
	TextView speaking, text;
	int state = 0;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		//removes title bar and sets the theme
        this.requestWindowFeature(Window.FEATURE_NO_TITLE); 
        
		super.onCreate(savedInstanceState);
		setContentView(R.layout.conversations);
		
		View nextButton = findViewById(com.Arkham.R.id.next_button);
		nextButton.setOnClickListener(this);
        
		speaking = (TextView) findViewById(R.id.speaker_name);
		text = (TextView) findViewById(R.id.speaking_text);
        
        speaking.setText( "Head Master: ");
        text.setText( Dialogue.introductions01() );
        
	}
	public void onClick(View v) {
    	Intent i;
    	switch (state)
    	{
    	case 0:
    		speaking.setText( "Prized Student: ");
    		text.setText( Dialogue.introductions02() );
    		state++;
    		break;
    	case 1:
    		speaking.setText( "George: ");
    		text.setText( Dialogue.introductions03() );
    		state++;
	    	break;
    	case 2:
    		speaking.setText( "George: ");
    		text.setText( Dialogue.introductions04() );
    		state++;
	    	break;
    	case 3:
    		speaking.setText( "??????: ");
    		text.setText( Dialogue.introductions05() );
    		state++;
	    	break;
    	case 4:
    		speaking.setText( "George: ");
    		text.setText( Dialogue.introductions06() );
    		state++;
	    	break;
    	case 5:
    		speaking.setText( "Matt: ");
    		text.setText( Dialogue.introductions07() );
    		state++;
	    	break;
    	case 6:
    		speaking.setText( "George: ");
    		text.setText( Dialogue.introductions08() );
    		state++;
	    	break;
    	case 7:
    		speaking.setText( "Matt: ");
    		text.setText( Dialogue.introductions09() );
    		//lost all of money
    		   GameFile.party.inventory.setMoney(0);
    		state++;
	    	break;
    	case 8:
    		speaking.setText( "Matt: ");
    		text.setText( Dialogue.introductions10() );
    		//Matt leaves
    		state++;
	    	break;
    	case 9:
    		speaking.setText( "Matt: ");
    		text.setText( Dialogue.introductions11() );
    		state++;
	    	break;
	    default:
	    	//testing to see where the dialogue ends 
	    	i = new Intent(this, GameMenu.class);
		    startActivity(i);
		    finish();
    	}
	}
}